home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / tcl / tclmotif.1 / tclmotif / tm.1.2 / src / tm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-20  |  4.4 KB  |  157 lines

  1.  
  2. #ifndef _TM_H
  3. #define _TM_H
  4.  
  5. #include <stdio.h>
  6. #include <stdlib.h>
  7. #include <tcl.h>
  8. #include <Xm/Xm.h>
  9.  
  10. #if XmVersion == 1001
  11. #  define MOTIF11
  12. #endif
  13.  
  14. #ifdef MOTIF11
  15. #include <X11/StringDefs.h>
  16. #include <X11/Xatom.h>
  17. #define XmFONTLIST_DEFAULT_TAG XmSTRING_DEFAULT_CHARSET
  18. #endif
  19.  
  20. #ifdef DEBUG_MALLOC
  21. #include <dbmalloc.h>
  22. #endif
  23.  
  24. #define TM_MAXARGS 100
  25. #define TM_NUM_PARAMS 10
  26.  
  27. /* global vbl names for stuf used in Text verify callbacks */
  28. #define TM_TEXT_DOIT "_Tm_Text_Doit"
  29. #define TM_TEXT_STARTPOS "_Tm_Text_StartPos"
  30. #define TM_TEXT_ENDPOS "_Tm_Text_EndPos"
  31. #define TM_TEXT_PTR "_Tm_Text_Ptr"
  32. #define TM_TEXT_LENGTH "_Tm_Text_Length"
  33.  
  34. /* global vbl names for result capturing */
  35. #define TM_RESULT_BUF "_Tm_Result_Buf"
  36. #define TM_SAVE_RESULT "_Tm_Save_Result"
  37.  
  38. /* global vbl names for stuff used in convertProc in D&D */
  39. #define TM_CONVERT_TYPE "_Tm_Convert_Type"
  40. #define TM_CONVERT_VALUE "Tm_Convert_Value"
  41.  
  42.  
  43. /*
  44.  * This contains info that is common to all widgets
  45.  * created under one display
  46.  */
  47. typedef struct Tm_Display {
  48.     Display    *display;
  49.     Widget    toplevel;
  50.     Widget    commWidget;    /* used for send command */
  51.     Atom     registryProperty;
  52.     Atom    commProperty;
  53. } Tm_Display;
  54.  
  55. /*
  56.  * each widget created by tcl has one of these
  57.  */
  58. typedef struct Tm_Widget {
  59.     Widget    widget;        /* Xt widget */
  60.     char    *pathName;    /* full path from `.' */
  61.     Tcl_Interp  *interp;    /* interp for this widget */
  62.     char     *parent;    /* parent path name from `.' */
  63.     char    *dropProc;    /* D&D proc */
  64.     char    *transferProc;    /* D&D proc */
  65.     char     *convertProc;    /* D&D proc */
  66.     Tm_Display    *displayInfo;    /* info shared by all in this interp */
  67. }   Tm_Widget;
  68.  
  69. /* This structure is used as the client data field in callback functions */
  70. typedef struct Tm_ClientData {
  71.     char    *callback_func;
  72.     Tm_Widget   *widget_info;
  73. }   Tm_ClientData;
  74.  
  75. /* This structure is used for Input Handlers */
  76. typedef struct Tm_InputData {
  77.     Tcl_Interp *interp;
  78.     char *command;    /* command to be executed by input handler */
  79. } Tm_InputData;
  80.  
  81. /* This structure is used for Timer Handlers */
  82. typedef struct Tm_TimerData {
  83.     Tcl_Interp *interp;
  84.     char *command;    /* command to be executed by input handler */
  85. } Tm_TimerData;
  86.  
  87. typedef struct {
  88.     char *fileName;
  89. }   Tm_ResourceType, *Tm_ResourceTypePtr;
  90.  
  91. typedef int (*Tm_WidgetCmdProc)_ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp,
  92.             int argc, char **argv));
  93.  
  94. /* used in drag and drop */
  95. typedef struct Tm_TransferStruct {
  96.     char *value;
  97.     char *closure;
  98. } Tm_TransferStruct;
  99.  
  100. /* some resource values need to be reclaimed after use in Set/GetValues
  101.    this data structure is used for a list of them
  102.  */
  103.  
  104. typedef void (*Tm_FreeProc) _ANSI_ARGS_((char *));
  105.  
  106. typedef struct Tm_FreeResourceType {
  107.     char *data;
  108.     Tm_FreeProc free;
  109. } Tm_FreeResourceType;
  110.  
  111. /* strings for use in widget create commands */
  112. #define xmArrowButton        "xmArrowButton"
  113. #define xmBulletinBoard        "xmBulletinBoard"
  114. #define xmBulletinBoardDialog    "xmBulletinBoardDialog"
  115. #define xmCascadeButton        "xmCascadeButton"
  116. #define xmCommand        "xmCommand"
  117. #define xmDialogShell        "xmDialogShell"
  118. #define xmDrawingArea        "xmDrawingArea"
  119. #define xmDrawnButton        "xmDrawnButton"
  120. #define xmErrorDialog        "xmErrorDialog"
  121. #define xmFileSelectionBox    "xmFileSelectionBox"
  122. #define xmFileSelectionDialog    "xmFileSelectionDialog"
  123. #define xmForm            "xmForm"
  124. #define xmFormDialog        "xmFormDialog"
  125. #define xmFrame            "xmFrame"
  126. #define xmInformationDialog    "xmInformationDialog"
  127. #define xmLabel            "xmLabel"
  128. #define xmList            "xmList"
  129. #define xmMainWindow        "xmMainWindow"
  130. #define xmMenuBar        "xmMenuBar"
  131. #define xmMessageBox        "xmMessageBox"
  132. #define xmMessageDialog        "xmMessageDialog"
  133. #define xmOptionMenu        "xmOptionMenu"
  134. #define xmPanedWindow        "xmPanedWindow"
  135. #define xmPopupMenu        "xmPopupMenu"
  136. #define xmPromptDialog        "xmPromptDialog"
  137. #define xmPulldownMenu        "xmPulldownMenu"
  138. #define xmPushButton        "xmPushButton"
  139. #define xmQuestionDialog    "xmQuestionDialog"
  140. #define xmRowColumn        "xmRowColumn"
  141. #define xmScale            "xmScale"
  142. #define xmScrollBar        "xmScrollBar"
  143. #define xmScrolledList        "xmScrolledList"
  144. #define xmScrolledText        "xmScrolledText"
  145. #define xmScrolledWindow    "xmScrolledWindow"
  146. #define xmSelectionBox        "xmSelectionBox"
  147. #define xmSelectionDialog    "xmSelectionDialog"
  148. #define xmSeparator        "xmSeparator"
  149. #define xmText            "xmText"
  150. #define xmTextField        "xmTextField"
  151. #define xmToggleButton        "xmToggleButton"
  152. #define xmTopLevelShell        "topLevelShell"
  153. #define xmWarningDialog        "xmWarningDialog"
  154. #define xmWorkingDialog        "xmWorkingDialog"
  155.  
  156. #endif /* _TM_H */
  157.